package Demo04;

import javax.swing.*;
import java.awt.*;
/*
  边界部局 ：东南西北中
 */
public class BorTest extends JFrame {
    private  JPanel mainPanel;
    private  JButton btn1,btn2,btn3,btn4,btn5;
    public  BorTest(){
        mainPanel=new JPanel(new BorderLayout());
        btn1=new JButton("east");
        btn2=new JButton("south");
        btn3=new JButton("west");
        btn4=new JButton("north");
        btn5=new JButton("center");

        //铺；
        setContentPane(mainPanel);
        //东，南，西，北，中；
        mainPanel.add(btn1,"East");
        mainPanel.add(btn2,"South");
        mainPanel.add(btn3,"West");
        mainPanel.add(btn4,"North");
        mainPanel.add(btn5,"Center");


        //窗口大小 ；
        setBounds(200,200,500,400);
        setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new BorTest();
    }
}
